import React from 'react';
import { observer, inject } from 'mobx-react';

@inject(({homeStore,routing})=>({
  homeStore,
  routing
}))

@observer
class Home extends React.Component {
  constructor(props) {
    super(props);
  }

  componentWillMount() {
    document.title = '主页面'
  }

  componentDidMount(){
    debugger;
    this.props.homeStore.getList()
  }
  
  render() {
    return (
          <div style={{ textAlign: 'left', width: '100%', margin: 'auto' }}>
           <p>下面是列表数据：</p>
          {
              this.props.homeStore.list && this.props.homeStore.list.map(el => (<div key={el.id}>标题：{el.title}</div>))
          }
          </div>

    );
  }
}

export default Home;
